<?php
use yii\widgets\LinkPager;
use yii\widgets\Breadcrumbs;
use app\modules\core\widgets\SlideNav;
?>

<div class="container-fluid">
	<div class="row">
        <?= SlideNav::widget() ?>
		<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 col-lg-10 col-lg-offset-2 main">
            <?= Breadcrumbs::widget([
                'homeLink' => ['label' => 'HOME', 'url' => '/core'],
                'links' => [
                    '内容',
                ]
            ]) ?>

			<div class="row">
				<div class="col-md-12 col-lg-12">
					<div class="alert alert-warning">
						 <button type="button" class="close" data-dismiss="alert">×</button>
						 <strong>警告!</strong> 请注意你的个人隐私安全.
					</div>
					<div class="">
						<a type="button" class="btn btn-primary pull-right" data-dismiss="alert" href="/core/content/create?id=sIJRYo98">新建</a>
					</div>
					<table class="table table-striped">
						<thead>
							<tr>
								<th>
								    ID
								</th>
								<th>
                                    URL
								</th>
								<th>
                                    标题
								</th>
								<th>
                                    作者
								</th>
								<th>
                                    修订时间
								</th>
								<th>
                                    ... ...
								</th>
							</tr>
						</thead>
						<tbody>
                            <?php foreach ($contents as $content) { ?>
							<tr class="">
								<td>
                                    <?php echo $content['id']; ?>
								</td>
								<td>
                                    <?php echo '--'; ?>
								</td>
								<td>
                                    <?php echo $content['title']; ?>
								</td>
								<td>
                                    <?php echo $content['author']; ?>
								</td>
								<td>
                                    <?php echo isset($content['ctime']) && ! empty($content['ctime']) ? date('Y-m-d H:i:s', $content['ctime']) : '- -'; ?>
								</td>
								<td>
                                    <a type="button" class="btn btn-default to-info" href="/core/content/edit?id=<?= $content['id'] ?>">编辑</a>
								</td>
							</tr>
                            <?php } ?>
						</tbody>
					</table>
				</div>
                <?php echo LinkPager::widget(['pagination' => $pagination, 'hideOnSinglePage' => false]) ?>
			</div>
		</div>
	</div>
</div>
